//
//  SYS_StoreVC.m
//  System_App
//
//  Created by 魏配军 on 2018/4/10.
//  Copyright © 2018年 czy001. All rights reserved.
//

#import "SYS_StoreVC.h"

@interface SYS_StoreVC ()<UIWebViewDelegate>
@property (nonatomic,strong) UIWebView *webView;
@end

@implementation SYS_StoreVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=DGHColor(242, 242, 242);
    [self initWithUI];
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

}

#pragma mark  ---------initWithUI-----
-(void) initWithUI
{
    _webView=[[UIWebView alloc]initWithFrame:CGRectMake(0, -StatusBarHeight, SCREENWIDTH, SCREENHEIGHT-TabBarHeight+StatusBarHeight)];
    _webView.delegate=self;
    _webView.dataDetectorTypes = UIDataDetectorTypeNone;
    _webView.scrollView.showsHorizontalScrollIndicator=NO;
    _webView.scrollView.showsVerticalScrollIndicator=NO;
    _webView.backgroundColor=DGHColor(242,242 , 242);
    [self.view addSubview:_webView];
//    NSString *session=[SYS_LoginModel instance].sessionInfo.session;
//    UICKeyChainStore *keychainStore = [UICKeyChainStore keyChainStore];
//    NSString *pid = [keychainStore stringForKey:@"pid"];
//    NSURL *url = [NSURL URLWithString:FORMAT(@"http://118.178.188.69:8081/index.html#/store/?session=%@&pid=%@", session,pid)];
    NSURL *url = [NSURL URLWithString:FORMAT(@"http://118.178.188.69:8081/index.html#/store/")];
    NSString *body=nil;
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:url];
    [request setHTTPMethod: @"GET"];
    [request setHTTPBody: [body dataUsingEncoding:NSUTF8StringEncoding]];
    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
    [_webView loadRequest: request];
    
}


#pragma mark ------UIWebViewDelegate---------
- (void)webViewDidStartLoad:(UIWebView *)webView {
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    

    
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
